<template>
    <div class="mui-numbox" data-numbox-min='1' :data-numbox-max='max'>
					<button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
					<input @change="getoknumber"  ref="oknumber" id="test" class="mui-input-numbox" type="number" value="1" />
					<button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
				</div>
</template>

<script>
import mui from '../../lib/mui/js/mui.min.js'
    export default{
        mounted () {
            this.numbox()
        },
        data () {
            return {
                id:this.$route.params.id
               
            }
        },
        props: ['max'],
        methods: {
            numbox(){
                mui('.mui-numbox').numbox()
            },
            getoknumber(){
                const ookk = parseInt(this.$refs.oknumber.value)
                this.$emit('select',ookk)
            }
         
        },
        watch:{
            'max':function(newvalue,oldvalue) {
                mui('.mui-numbox').numbox().setOption('max',newvalue)
            }
        }
    }
</script>

<style lang="less" scoped>

</style>

